from sqlalchemy import VARCHAR, Integer, String
from App.ext import models
from sqlalchemy.dialects.mysql import INTEGER


class User(models.Model):
    __tablename__ = 'user'

    id = models.Column(INTEGER(4), primary_key=True)
    email = models.Column(String(255), nullable=False)
    username = models.Column(String(45), nullable=False)
    password = models.Column(String(45), nullable=False)
    isTeam = models.Column(String(255))


class School(models.Model):
    __tablename__ = 'school'

    id = models.Column(Integer(), primary_key=True, autoincrement=True)
    label = models.Column(String(255))
    describe = models.Column(String(255))


class Targetlist(models.Model):
    __tablename__ = 'targetlist'

    id = models.Column(INTEGER(11), primary_key=True)
    name = models.Column(String(255))





class Topic(models.Model):
    __tablename__ = 'topic'

    id = models.Column(INTEGER(11), primary_key=True)
    describe = models.Column(String(255))
    name = models.Column(String(255))
    type = models.Column(String(255))
    year = models.Column(String(255))


class Team(models.Model):
    __tablename__ = 'team'

    id = models.Column(INTEGER(11), primary_key=True)
    className = models.Column(String(255))
    leader = models.Column(String(255))
    inviteCode = models.Column(String(255))
    peopleNum = models.Column(INTEGER(11))


class EmailVerify(models.Model):
    __tablename__ = 'email_verify'

    id = models.Column(INTEGER(24), primary_key=True)
    email = models.Column(String(255), nullable=False)
    code = models.Column(String(255))
    
    
class UserInformation(models.Model):
    __tablename__ = 'user_information'

    id = models.Column(INTEGER(11), primary_key=True)
    username = models.Column(String(255))
    email = models.Column(String(255))
    age = models.Column(INTEGER(11))
    playertype = models.Column(String(255))
    school = models.Column(VARCHAR(255))
    city = models.Column(String(255))
    schoolCity = models.Column(String(255))
    schoolcode = models.Column(INTEGER(11))
    gender = models.Column(INTEGER(11))
